home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / mac / ez_dove.hqx / EZ Dove / EZ DOVE .002 (BAS) < prev    next >
Text File  |  1990-02-12  |  10KB  |  261 lines

  1. 'EZ DOVE v.002, by N5KOB.  12 Feb. 1990.
  2. 'decodes TLM telemetry from DOVE-1 ham radio satellite.
  3.   DEFINT a-Z
  4.   GOSUB Helper
  5.   WINDOW 1, "DOVE-1 Decoder", ,1
  6. Initialize:
  7.   RESTORE 'reset DATA pointer
  8.   MENU 1,0,1,"File"
  9.   MENU 1,1,1,"Help"
  10.   MENU 1,2,1,"Start"
  11.   MENU 1,3,1,"Quit"
  12.   MENU 1,4,1, "AMSAT"
  13.   CALL TEXTSIZE (12)
  14.   GOSUB OpenInputFile
  15.   GOSUB OpenOutputFile
  16. MakeHeader:
  17.    GOSUB HeaderMaker
  18. LINE INPUT#1, InLine$ 'dummy command
  19. MakeMainResults:
  20.    RowNum = 2: ColumnNum = 1: NumTelemValues = 58
  21.    Read8Lines: 'creates BigLine$
  22.       BigLine$ = ""
  23.       FOR M=1 TO 8
  24.          LINE INPUT #1, InLine$
  25.          BigLine$ = BigLine$ + InLine$
  26.       NEXT M
  27.      GOSUB FindValueToDecode
  28. CALL TEXTSIZE (10): LOCATE 22,30: PRINT "All Done"
  29. CLOSE #1: CLOSE #2
  30. GOTO JustWaiting
  31. '------------------------------------------------------------
  32. AmsatInfo:
  33.    WINDOW 3, "AMSAT Info", (100,65)-(370,175),-4
  34.    CALL TEXTSIZE(10)
  35.    PRINT  "If you develop an interest in amateur satellites, you"
  36.    PRINT  "might want to join AMSAT, P.O. Box 27, Washington,"
  37.    PRINT  "D.C. 20044.  (You can call them at (301) 589-6062"
  38.    PRINT  "and join with Visa or MasterCard.)  They publish an"
  39.    PRINT  "excellent newsletter and have publications and"
  40.    PRINT  "software for beginners and experienced enthusiasts."
  41.    PRINT  "                 Click in this window to continue"
  42.    MOUSE ON
  43.    i=0: WHILE i=0: ON MOUSE GOSUB Dummy5: WEND
  44.    RETURN
  45. Dummy5:
  46.    WINDOW CLOSE 3
  47.    MOUSE OFF
  48.    i=1
  49.    RETURN
  50. '-----------------
  51. AssembleAnswerLine:
  52.    AnswerLine$ = VariableName$ + "= "  + STR$(Result!) + " " + Units$
  53.    AnswerLineFile$ = VariableName$ + CHR$(9)  + STR$(Result!) + CHR$(9) + Units$
  54.    RETURN
  55. '---------------
  56. CalcValues:
  57.    TelemDecimal=VAL("&H" + TelemHex$) 'converts hex to decimal
  58.    Result! = (ACoeff!*TelemDecimal^2) + (BCoeff!*TelemDecimal) + CCoeff!
  59.    RETURN
  60. '---------------
  61. EndlessLoop:
  62.    WHILE 1=1: WEND
  63. '---------------
  64. ErrorMessage1: 'if string = 1023 characters, goto ErrorMessage1
  65.    PRINT "Sorry, a line has been encountered in the input file that has more than 1022"
  66.    PRINT  "characters without a carriage return.  This program cannot handle that."
  67.    PRINT  "a situation like that.  You may wish to enter a Return character in the file"
  68.    PRINT "with a word processor and start over.  Bye bye."
  69.    GOTO Initialize
  70. '---------------
  71. FindValueToDecode:
  72.    FOR L=1 TO LEN(BigLine$)-2
  73.       ColonIHope$ = MID$(BigLine$,L,1)
  74.       IF ColonIHope$ <> ":" GOTO Dummy1 'you haven't found a colon yet
  75.       TelemHex$ = MID$(BigLine$,L+1,2) 'here's the telemetry to decode
  76.       Test$ = MID$(BigLine$,L-2,2)
  77.       IF Test$ = "LM"  GOTO Dummy1 'handles the  colon after "TLM:"
  78.       IF Test$ = "US" GOTO Dummy3 'handles the colon after "STATUS:"
  79.       IsRightItem: 'xxx
  80.         GOSUB GetDATAValues 'xxx
  81.    GOSUB CalcValues
  82.    GOSUB AssembleAnswerLine
  83.    GOSUB OutputAnswerLine 'to screen and file
  84.    Dummy1:
  85.    NEXT L
  86.    Dummy3: 'all done
  87.    RETURN
  88. '---------------
  89. GetDATAValues:
  90.    'ON ERROR STOP 'xxx, could restore
  91.    READ IDNum$, VariableName$, CCoeff!, BCoeff!, ACoeff!, Units$
  92.    RETURN
  93. '---------------
  94. HeaderMaker:
  95.    SearchString$= "Time is": SStringLen = 7: GOSUB SearchForString
  96.    Header$ = MID$(InLine$ ,SStringPos ,32) 'get 32 characters that tell date & time
  97.    CALL TEXTSIZE(12): LOCATE 1, 12: PRINT Header$
  98.    IF FileOut$ <> "" THEN PRINT #2, Header$ 'write time & date to file, if there is one
  99.    RETURN
  100. '---------------
  101. Helper:
  102.    WINDOW 2, "Help Screen", (15,45)-(450,335),-4
  103.    CALL TEXTSIZE(10)
  104.    PRINT  "                                             EZ Dove v. 002"
  105.    PRINT  "          Based upon information received from Robert McGwier, N4HY."
  106.    PRINT  "          Written in Microsoft QuickBASIC, version 1.0, for the Macintosh"
  107.    PRINT 
  108.    PRINT  "     This program decodes some of the telemetry that you can receive from the DOVE ham"
  109.    PRINT  "radio satellite, launched in early 1990.  To obtain telemetry to decode you will need a"
  110.    PRINT  "receiver capable of tuning 145.825 MHz, a Terminal Node Controller (TNC), and a"
  111.    PRINT  "computer."
  112.    PRINT  "     When you run this program, it will ask you to select the file of telemetry data to be"
  113.    PRINT  "decoded.  It will then ask you if you want to save the data to an output file, so that you"
  114.    PRINT  "can import it to a spreadsheet.  Then it will start the decoding process."
  115.    PRINT  "     Decoding may seem to take a very long time, but actually the main slow-down is that"
  116.    PRINT  "the program is looking for the line of telemetry that tells the time.  Hint:  If you erase"
  117.    PRINT  "any lines ahead of the one with the time, Mr. Mac won't have to look so far."
  118.    PRINT "     The telemetry that this program decodes is in the TLM lines from DOVE.  If they are"
  119.    PRINT  "garbled, unpredictable results may occur."
  120.    PRINT  "     If you would like more information about amateur radio, please ask a local ham or"
  121.    PRINT  "write the American Radio Relay League, 225 Main St., Newington  CT  06111.  You will"
  122.    PRINT  "be glad you did!"
  123.    PRINT  "                Miles Abernathy, N5KOB @ KB5PM.#STX.TX.USA.NA"
  124.    PRINT 
  125.    PRINT  "                                                            Click mouse";
  126.    MOUSE ON
  127.    i=0: WHILE i=0: ON MOUSE GOSUB Dummy4: WEND
  128.    RETURN
  129. Dummy4:
  130.    WINDOW CLOSE 2
  131.    MOUSE OFF
  132.    i=1
  133.    RETURN
  134. '--------------
  135. 'InputErrorHandler: xxx
  136.    CLOSE #1
  137.    IF ERR = 23 THEN GOTO ErrorMessage1
  138.    PRINT  "Programmer error #"; ERR; ".": GOSUB LongDelay
  139.    STOP
  140. '---------------
  141. JustWaiting:
  142.    MENU ON: ON MENU GOSUB MenuHandler: GOTO JustWaiting
  143. MenuHandler:
  144.    MenuNumber = MENU(0)
  145.    MenuItem = MENU(1)
  146.    MENU 'de-highlights menu
  147.    ON MenuNumber <> 1 GOTO Quitter
  148.    ON MenuItem GOSUB Helper, Initialize, Quitter, AmsatInfo
  149.    RETURN
  150. '---------------
  151. LongDelay:
  152.    t!=TIMER + 10: WHILE t!>TIMER: WEND: RETURN
  153. '---------------
  154. OpenInputFile:
  155.    LOCATE 1,14: PRINT  "Select input file of DOVE telemetry."
  156.    FileIn$=FILES$ (1, "TEXT")
  157.    IF FileIn$ = "" THEN GOTO Quitter
  158.    CLS
  159.    OPEN FileIn$ FOR INPUT AS #1
  160. RETURN
  161. '---------------
  162. OpenOutputFile:
  163.    LOCATE 1,5: PRINT "Do you want to save the decoded telemetry to a file?"
  164.    FileOut$=FILES$ (0, "Save output as")
  165.    IF FileOut$ = "" THEN CLS: RETURN
  166.    CLS
  167.    OPEN FileOut$ FOR OUTPUT AS #2
  168. RETURN
  169. '---------------
  170. OutputAnswerLine:
  171.    CALL TEXTSIZE (9)
  172.    RowNum = RowNum + 1
  173.    IF RowNum > 22 THEN RowNum = 3: ColumnNum = ColumnNum + 27
  174.    LOCATE RowNum, ColumnNum: PRINT AnswerLine$ 'print to screen
  175.    IF FileOut$ <> "" THEN PRINT #2, AnswerLineFile$ 'write to file, if there is one
  176.    RETURN
  177. '---------------
  178. Quitter:
  179.    MENU RESET
  180.    END
  181. '--------------
  182. SearchForString: 'finds first occurrence of a string in the file
  183.   InLineNum = 0
  184.   WHILE NOT EOF(1)
  185.    'ON ERROR GOTO InputErrorHandler xxx
  186.    LINE INPUT#1, InLine$
  187.    InLineNum=InLineNum + 1
  188.    SStringPos=0
  189.    FOR J=1 TO LEN(InLine$) 'finds first occurrence of SearchString$ in the line
  190.       CharMenu$ = "Char "+ STR$ (J): LineMenu$ = " Line" + STR$ (InLineNum)
  191.       MENU 3,0,0,LineMenu$: MENU 4, 0, 0, CharMenu$
  192.       IF SearchString$=MID$(InLine$,J,SStringLen) THEN
  193.          SStringPos=J
  194.          J=LEN(InLine$)
  195.          RETURN
  196.          END IF
  197.    NEXT J
  198.   WEND
  199. RETURN
  200. '---------------
  201. DATA "00", Rx E/F Audio(W), 0, .0246, 0, V(p-p)
  202. DATA "01", Rx E/F Audio(N), 0, .0246, 0, V(p-p)
  203. DATA "02", Mixer Bias, 0, .0102, 0, Volts
  204. DATA "03", Oscillator Bias, 0, .0102, 0, Volts
  205. DATA "04", Rx A Audio(W), 0, .0246, 0, V(p-p)
  206. DATA "05", Rx A Audio(N), 0, .0246, 0, V(p-p)
  207. DATA "06", "Rx A DISC   ", 10.427, -.09274, 0, kHz
  208. DATA "07", Rx A S Meter, 0, 1, 0, Counts
  209. DATA "08", Rx E/F DISC, 9.6234, -.09911, 0, kHz
  210. DATA "09", Rx E/F S Meter, 0, 1, 0, Counts
  211. DATA "0A", +5 volt bus, 0, .0305, 0, Volts
  212. DATA "0B", +5V Rx Current, 0, .1, 0, mA
  213. DATA "0C", +2.5 volt VREF, 0, .0108, 0, Volts
  214. DATA "0D", "8.5 volt bus    ", 0, .0391, 0, Volts
  215. DATA "0E", IR Detector, 0, 1, 0, Counts
  216. DATA "0F", LO Monitor I, 0, .037, 0, mA
  217. DATA "10", +10 volt bus, 0, .05075, 0, Volts
  218. DATA "11", GASFET Bias I, 0, .026, 0, mA
  219. DATA "12", Ground REF, 0, .01, 0, Volts
  220. DATA "13", +Z Array voltage, 0, .1023, 0, Volts
  221. DATA "14", "Rx Temp      ", 101.05, -.6051, 0, íC
  222. DATA "15", +X (RX) Temp, 101.05, -.6051, 0, íC
  223. DATA "16", Bat. 1 volts, 1.7932, -.0034084, 0, Volts
  224. DATA "17", Bat. 2 volts, 1.7978, -.0035316, 0, Volts
  225. DATA "18", Bat. 3 volts, 1.8046, -.0035723, 0, Volts
  226. DATA "19", Bat. 4 volts, 1.7782, -.0034590, 0, Volts
  227. DATA "1A", Bat. 5 volts, 1.8410, -.0038355, 0, Volts
  228. DATA "1B", Bat. 6 volts, 1.8381, -.0038450, 0, Volts
  229. DATA "1C", Bat. 7 volts, 1.8568, -.0037757, 0, Volts
  230. DATA "1D", Bat. 8 volts, 1.7868, -.0034068, 0, Volts
  231. DATA "1E", Array voltage, 7.205, .072, 0, Volts
  232. DATA "1F", +5   volt bus, 1.932, .0312, 0, Volts
  233. DATA "20", +8.5 volt bus, 5.265, .0173, 0, Volts
  234. DATA "21", +10  volt bus, 7.469, .021765, 0, Volts
  235. DATA "22", BCR set point, -8.762, 1.159, 0, Counts
  236. DATA "23", BCR load I, -.0871, .00698, 0, Amps
  237. DATA "24", +8.5V bus I, -.0092, .001899, 0, Amps
  238. DATA "25", +5  V bus cur., .00502, .00431, 0, Amps
  239. DATA "26", -X array cur., -.01075, .00215, 0, Amps
  240. DATA "27", +X array cur., -.01349, .00270, 0, Amps
  241. DATA "28", -Y array cur., -.01196, .00239, 0, Amps
  242. DATA "29", +Y array cur., -.01141, .00228, 0, Amps
  243. DATA "2A", -Z array cur., -.01653, .00245, 0, Amps
  244. DATA "2B", +Z array cur., -.01137, .00228, 0, Amps
  245. DATA "2C", Ext. Power cur., -.02, .00250, 0, Amps
  246. DATA "2D", BCR Input cur., .06122, .00317, 0, Amps
  247. DATA "2E", BCR Output cur., -.01724, .00345, 0, Amps
  248. DATA "2F", Battery 1 temp, 101.05, -.6051, 0, íC
  249. DATA "30", Battery 2 temp, 101.05, -.6051, 0, íC
  250. DATA "31", Baseplate temp, 101.05, -.6051, 0, íC
  251. DATA "32", FM TX#1 RF out, .0256, -.000884, .0000836, Watt
  252. DATA "33", FM TX#2 RF out, -.0027, .001257, .0000730, Watt
  253. DATA "34", PSK TX HPA temp, 101.05, -.6051, 0, íC
  254. DATA "35", +Y array temp, 101.05, -.6051, 0, íC
  255. DATA "36", RC PSK HPA temp, 101.05, -.6051, 0, íC
  256. DATA "37", RC PSK BP temp, 101.05, -.6051, 0, íC
  257. DATA "38", +Z array temp, 101.05, -.6051, 0, íC
  258. DATA "39", S band TX out, -.0451, .00403, 0, Watts
  259. DATA "3A", S band HPA temp, 101.05, -.6051, 0, íC
  260.  
  261.